package org.sg20.pagerank.pagerankviewer;

import org.sg20.graphbuilder.GraphBuilderDriver;
import org.sg20.pagerank.pagerankiter.PageRankIterDriver;

import java.io.IOException;

public class PageRankDriver {
    private static int times = 10;

    public static void main(String args[]) throws IOException, InterruptedException, ClassNotFoundException {
        String[] forGB = {"", args[1] + "/PagerankItr0"};
        forGB[0] = args[0];
        GraphBuilderDriver.main(forGB[0], forGB[1]);

        String[] forItr = {"Data", "Data"};
        for (int i = 0; i < times; i++) {
            forItr[0] = args[1] + "/PagerankItr" + (i);
            forItr[1] = args[1] + "/PagerankItr" + (i + 1);
            PageRankIterDriver.main(forItr[0], forItr[1]);
        }

        String[] forRV = {args[1] + "/PagerankItr" + times, args[1] + "/FinalRank"};
        PageRankViewerDriver.main(forRV[0], forRV[1]);
    }
}
